package com.vito.config.i18n;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;

import java.util.Locale;

/**
 * TODO
 * 国际化支持
 *
 * @Version 1.0
 * @Author zhaoyue
 * @Date 2020/10/27 18:25
 */
@Configuration
public class LocaleConfig {

	//用于设置当前会话的默认的国际化语言。
	@Bean
	public LocaleResolver localeResolver() {
		SessionLocaleResolver sessionLocaleResolver = new SessionLocaleResolver();
		sessionLocaleResolver.setDefaultLocale(Locale.CHINA);
		return sessionLocaleResolver;
	}
}
